package beans;

import entities.Hotel;
import controllers.HotelFacade;
import java.io.Serializable;
import java.util.ResourceBundle;
import javax.annotation.PostConstruct;
import javax.annotation.security.RolesAllowed;
import javax.faces.event.ActionEvent;
import javax.inject.Named;
import javax.inject.Inject;
import javax.faces.view.ViewScoped;

@Named(value = "hotelController")
@ViewScoped
public class HotelController extends AbstractController<Hotel> implements Serializable {

    @Inject
    private HotelFacade ejbFacade;

    public HotelController() {
        super(Hotel.class);
    }

    @PostConstruct
    public void init() {
        super.setFacade(ejbFacade);
    }
    
    
    @Override    
    @RolesAllowed("ADMIN")
    public void save(ActionEvent event) {
        String msg = ResourceBundle.getBundle("/Bundle").getString(itemClass.getSimpleName() + "Updated");
        super.persist(PersistAction.UPDATE, msg);
    }

}
